-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RAC] [RBAC] force rule data client to register features #20
[RAC] [RBAC] force rule data client to register features #20
Conversation
…e master list which maps feature id to index names
a5d5ff5
to
879c0c0
Compare
@@ -46,6 +46,15 @@ interface GetAlertParams { | |||
index?: string; | |||
} | |||
|
|||
export const validFeatureIds = ['apm', 'observability', 'siem'] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we distinguish between observability
and apm
, etc. Is apm
a subset of observability
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data grid should know where it is.. but yeah I think that's what observability is going for with their "top alerts" rule which looked to be querying .alerts
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a few TS suggestions and a suggestion for where to store the main mapping object. Thanks so much!
alias: plugins.ruleRegistry.ruleDataService.getFullAssetName(), | ||
feature: 'observability', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does listing the feature do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of the feature
param is to force the user to update the data structure which contains the mapping of consumers to alerts as data indices. The idea is it is typed such that it forces the user to go to the code and modify it. At least until a better system is put in place or we move the alerts as data client out of rule registry.
x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts
Outdated
Show resolved
Hide resolved
f213f64
to
fbd3905
Compare
c4b7ace
to
d2173f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and by G I mean GREAT
* force any plugin registering rules to register the feature id into the master list which maps feature id to index names * javascript is not python * favor keyof instead of typeof as const, removes ts-expect-error * updates typedocs * adds rbac utils to utils folder and updates typedocs * featureIds is already string[] and do not trust input for type guard
* force any plugin registering rules to register the feature id into the master list which maps feature id to index names * javascript is not python * favor keyof instead of typeof as const, removes ts-expect-error * updates typedocs * adds rbac utils to utils folder and updates typedocs * featureIds is already string[] and do not trust input for type guard
* force any plugin registering rules to register the feature id into the master list which maps feature id to index names * javascript is not python * favor keyof instead of typeof as const, removes ts-expect-error * updates typedocs * adds rbac utils to utils folder and updates typedocs * featureIds is already string[] and do not trust input for type guard
Summary
force any plugin registering rules to register the feature id into the master list which maps feature id to index names
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers